//============================================================================ //Gios Pdf.NET - A library for exporting Pdf Documents in C# //Copyright (C) 2005 Paolo Gios - www.paologios.com // //This library is free software; you can redistribute it and/or //modify it under the terms of the GNU Lesser General Public //License as published by the Free Software Foundation; either //version 2.1 of the License, or (at your option) any later version. // //This library is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //Lesser General Public License for more details. // //You should have received a copy of the GNU Lesser General Public //License along with this library; if not, write to the Free Software //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //============================================================================= using System; using System.Drawing; namespace HH.WMS.Utils.Gios.Pdf { /// /// Cell of a PdfTable /// public class PdfCell { internal PdfDocument PdfDocument { get { return this.owner.PdfDocument; } } internal string stringFormat; internal double Height { get { return this.owner.Rows[row].Height; } } internal string text { get { string testo=""; if (this.content!=null) testo=String.Format(this.stringFormat,this.content); return testo; } } internal double Width { get { return this.owner.Columns[column].CompensatedWidth; } } internal double cellPadding; internal int row,column; internal object content; /// /// gets the Content inside the Cell. /// public object Content { get { return this.content; } } internal int colSpan,rowSpan; /// /// gets or sets the Column Span of the Cell. /// public int ColSpan { get { return this.colSpan; } set { if (value<=0) throw new Exception("ColSpan must be grater than zero."); this.colSpan=value; for (int r=this.row;r /// gets or sets the Row Span of the Cell. /// public int RowSpan { get { return this.rowSpan; } set { if (value<=0) throw new Exception("RowSpan must be grater than zero."); this.rowSpan=value; for (int r=this.row+1;r1) { for (int c=column;c /// sets the font to be used in the Cell. /// /// public void SetFont(Font Font) { this.Font=Font; } /// /// sets the background color of the Cell. /// /// public void SetBackgroundColor(Color BackgroundColor) { this.backgroundColor=BackgroundColor; this.transparent=false; } /// /// sets the foreground color of the Cell. /// /// public void SetForegroundColor(Color ForegroundColor) { this.foregroundColor=ForegroundColor; } /// /// sets the Content Alignment of the Cell. /// /// public void SetContentAlignment(ContentAlignment ContentAlignment) { this.ContentAlignment=ContentAlignment; } /// /// sets the background and foreground colors of the Cell. /// /// /// public void SetColors(Color ForegroundColor,Color BackgroundColor) { this.SetForegroundColor(ForegroundColor); this.SetBackgroundColor(BackgroundColor); } /// /// makes the Cell background a transparent layer. /// public void SetTransparent() { this.transparent=true; } /// /// sets the Padding of the Cell. /// /// public void SetCellPadding(double CellPadding) { if (CellPadding<0) throw new Exception("CellPadding must be non-negative."); this.cellPadding=CellPadding; } /// /// Sets the content of the cell. /// /// public void SetContent(object Content) { this.content=Content; } /// /// Sets the string Format of the Cell /// /// public void SetContentFormat(string Format) { this.stringFormat=Format; } } }